<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'deviceList.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="ui/js/jquery.js"></script>
	<script type="text/javascript" src="ui/js/framework.js"></script>
	<link href="ui/css/import_basic.css" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" type="text/css" id="skin" prePath="/"/>
	<link rel="stylesheet" type="text/css" id="customSkin"/>
	<link href="ui/skins/blue/style.css" rel="stylesheet" type="text/css" id="theme" themeColor="blue"/>
<!--框架必需end-->
	<!--树组件与弹窗组件（这里引入只为“非iframe弹窗（复杂内容）”示例需要） -->
	<script type="text/javascript" src="ui/js/tree/ztree/ztree.js"></script>
	<link href="ui/js/tree/ztree/ztree.css" rel="stylesheet" type="text/css"/>
	<script type="text/javascript" src="ui/js/popup/drag.js"></script>
	<script type="text/javascript" src="ui/js/popup/dialog.js"></script>
	<!--树组件与弹窗组件（这里引入只为“非iframe弹窗（复杂内容）”示例需要） -->
<style>
.boxgrid{ 
	width: 128px; 
	height: 128px; 
	margin:8px; 
	float:left; 
	/*background:#161613;*/ 
	border: solid 2px #8399AF; 
	overflow: hidden; 
	position: relative; 
	margin-left: 14px;
}
</style>
<script>
function initComplete(){
	//初始时有标题
	$('.boxgrid.caption').each(function(){
		$(".cover", this).css({
			top:"95px"
		});
	});
	$('.boxgrid.caption').hover(function(){
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'95px'},{queue:false,duration:160});
	});
}			
		function addDevice($obj){
			location.href='deviceTran.action?dmId='+'${dmId}';
		}
</script>
<script type="text/javascript">
			$(function(){
			$(".dDelete").click(function(){
				deleteDevice($(this));
			});
		});
		/*删除设备*/
		function deleteDevice($obj){	
			top.Dialog.confirm("确定要删除吗？",function(){
				//var id = $("#deviceId").html();
				var id = $obj.parents("div").parents("div").find("div").eq(1).html();
				//var strs = new Array();
				strs = id.split(":");
				var dId = strs[1];
				//alert(id);
				location.href='deviceDel.action?deviceId='+dId;	
		});
		}
</script>
</head>
<body>
      <fieldset>
       	<legend>管理域设备列表</legend>
       	<s:if test="">
       			
       	</s:if>
       	<div style=""><input type="button" value="添加设备" id="addDevice" onclick="addDevice()"></div>
       	
       		<s:iterator value="deviceList" var="dl" step="num" >
       			<div class="boxgrid caption">
       			<s:if test="%{#dl.dType==1}">
       				<img src="ui/images/devices/computer.png"></img>
       			</s:if>
       			<s:if test="%{#dl.dType==0}">
       				<img src="ui/images/devices/printer.png"></img>
       			</s:if>
       			
				<div class="cover boxcaption">
					<div class="boxgrid_con">设备名:<s:property value="#dl.dName"/></div>
					<div class="boxgrid_con" id="deviceId">设备编号:<s:property value="#dl.dId"/></div>
					<div class="boxgrid_con">设备类型:
						<s:if test="%{#dl.dType==1}">个人电脑</s:if>
						<s:if test="%{#dl.dType==0}">打印机</s:if>
					</div>
					<div class="boxgrid_con">
						<a class="boxgrid_con" href="<%=path %>/deviceOperation.action?dId=<s:property value="#dl.dId"/>" target="frmrightChild" >更多操作</a>
						<a href="javascript:;" class="dDelete" style="color: white;">删除设备</a>
					</div>
				</div>		
			</div>
       		</s:iterator>
			<div class="clear"></div>
	</fieldset>
	<div class="height_15"></div>
  </body>
</html>
